<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>客户特点管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            //$("#name").focus();
            $("#inputForm").validate({
                 submitHandler: function (form) {
                     loading('正在提交，请稍等...');
                     form.submit();
                 },
                 errorContainer: "#messageBox",
                 errorPlacement: function (error, element) {
                     $("#messageBox").text("输入有误，请先更正。");
                     if (element.is(":checkbox") || element.is(":radio")
                         || element.parent().is(".input-append")) {
                         error.appendTo(element.parent().parent());
                     } else {
                         error.insertAfter(element);
                     }
                 }
             });
        });
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li><a href="${ctx}/sys/customerFeature/">客户特点列表</a></li>
    <li class="active"><a href="javascript:void(0);">客户特点<shiro:hasPermission
            name="sys:customerFeature:edit">${not empty customerFeature.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission
            name="sys:customerFeature:edit">查看</shiro:lacksPermission></a></li>
</ul>
<br/>
<form:form id="inputForm" modelAttribute="customerFeature" action="${ctx}/sys/customerFeature/save"
           method="post" class="form-horizontal">
    <form:hidden path="id"/>
    <form:hidden path="historyFlag"/>
    <sys:message content="${message}" onMessage="false"/>
    <div class="control-group">
        <label class="control-label">名称：</label>

        <div class="controls">
            <form:input path="name" htmlEscape="false" maxlength="128" class="input-xlarge required"/>
            <span class="help-inline"><font color="red">*</font> </span>
        </div>
    </div>
    <c:if test="${not empty customerFeature.id}">
        <div class="control-group">
            <label class="control-label">创建日期：</label>
            <div class="controls">
                <fmt:formatDate pattern="yyyy-MM-dd hh:mm:ss" value="${customerFeature.dateCreated}"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">更新日期：</label>
            <div class="controls">
                <fmt:formatDate pattern="yyyy-MM-dd hh:mm:ss" value="${customerFeature.lastUpdated}"/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">创建人：</label>
            <div class="controls">
                    ${fns:getUserById(customerFeature.createBy.id).name}
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">修改人：</label>
            <div class="controls">
                    ${fns:getUserById(customerFeature.updateBy.id).name}
            </div>
        </div>
    </c:if>
    <div class="form-actions">
        <shiro:hasPermission name="sys:customerFeature:edit">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
        </shiro:hasPermission>
        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="javascript:history.go(-1*${customerFeature.historyFlag});"/>
    </div>
</form:form>
</body>
</html>